<div class="container">
    <div class="_datagrid">
        <table id="news_dg"></table>
    </div>
</div>
<script>
    var news_dg;
    $(function () {
        news_dg = $('#news_dg').datagrid({
            url: "#(ctx)/admin/news/newsList",
            fitColumns: true,
            pagination: true,
            rownumbers: true,
            striped: true,
            singleSelect: true,
            pageSize: 10,
            pageList: [10, 20, 30],
            idField: 'id',
            columns: [
                [{
                    field: 'id',
                    width: 100,
                    hidden: true,
                    title: 'id'
                }, {
                    field: 'siteName',
                    title: 'siteName',
                    width: 50
                }, {
                    field: 'authorName',
                    title: 'authorName',
                    width: 50
                }, {
                    field: 'url',
                    title: 'url',
                    width: 80
                }, {
                    field: 'title',
                    title: 'title',
                    width: 150,
                }, {
                    field: 'summary',
                    title: 'summary',
                    width: 150
                },{
                    field: 'publishDate',
                    title: 'publishDate',
                    width: 100
                }, {
                    field: '操作',
                    title: '操作',
                    width: 60,
                    formatter: function (value, row, index) {
                        return '<a href="'+row.url+'" target="_blank">打开原文</a>'
                    }
                }]
            ],
            toolbar: '#user_tb'
        });
    })

</script>